/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package uimigration.uipositionning.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import uimigration.Interactions.InteractionsPackage;

import uimigration.Interactions.impl.InteractionsPackageImpl;

import uimigration.Plateform.PlateformPackage;

import uimigration.Plateform.impl.PlateformPackageImpl;

import uimigration.UIModel.UIModelPackage;

import uimigration.UIModel.impl.UIModelPackageImpl;

import uimigration.WidgetsModel.WidgetsModelPackage;

import uimigration.WidgetsModel.impl.WidgetsModelPackageImpl;

import uimigration.mappingmodel.MappingmodelPackage;

import uimigration.mappingmodel.impl.MappingmodelPackageImpl;

import uimigration.uipositionning.Absolute;
import uimigration.uipositionning.AttachedTo;
import uimigration.uipositionning.DownTo;
import uimigration.uipositionning.LeftTo;
import uimigration.uipositionning.NestedIn;
import uimigration.uipositionning.NestedPositionType;
import uimigration.uipositionning.Positionning;
import uimigration.uipositionning.Relative;
import uimigration.uipositionning.RightTo;
import uimigration.uipositionning.TopTo;
import uimigration.uipositionning.UipositionningFactory;
import uimigration.uipositionning.UipositionningPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class UipositionningPackageImpl extends EPackageImpl implements
		UipositionningPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass positionningEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass absoluteEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass relativeEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass leftToEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass rightToEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass topToEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass downToEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass attachedToEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass nestedInEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum nestedPositionTypeEEnum = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see uimigration.uipositionning.UipositionningPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private UipositionningPackageImpl() {
		super(eNS_URI, UipositionningFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link UipositionningPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static UipositionningPackage init() {
		if (isInited) return (UipositionningPackage)EPackage.Registry.INSTANCE.getEPackage(UipositionningPackage.eNS_URI);

		// Obtain or create and register package
		UipositionningPackageImpl theUipositionningPackage = (UipositionningPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof UipositionningPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new UipositionningPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		UIModelPackageImpl theUIModelPackage = (UIModelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(UIModelPackage.eNS_URI) instanceof UIModelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(UIModelPackage.eNS_URI) : UIModelPackage.eINSTANCE);
		InteractionsPackageImpl theInteractionsPackage = (InteractionsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(InteractionsPackage.eNS_URI) instanceof InteractionsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(InteractionsPackage.eNS_URI) : InteractionsPackage.eINSTANCE);
		WidgetsModelPackageImpl theWidgetsModelPackage = (WidgetsModelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(WidgetsModelPackage.eNS_URI) instanceof WidgetsModelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(WidgetsModelPackage.eNS_URI) : WidgetsModelPackage.eINSTANCE);
		PlateformPackageImpl thePlateformPackage = (PlateformPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(PlateformPackage.eNS_URI) instanceof PlateformPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(PlateformPackage.eNS_URI) : PlateformPackage.eINSTANCE);
		MappingmodelPackageImpl theMappingmodelPackage = (MappingmodelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(MappingmodelPackage.eNS_URI) instanceof MappingmodelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(MappingmodelPackage.eNS_URI) : MappingmodelPackage.eINSTANCE);

		// Create package meta-data objects
		theUipositionningPackage.createPackageContents();
		theUIModelPackage.createPackageContents();
		theInteractionsPackage.createPackageContents();
		theWidgetsModelPackage.createPackageContents();
		thePlateformPackage.createPackageContents();
		theMappingmodelPackage.createPackageContents();

		// Initialize created meta-data
		theUipositionningPackage.initializePackageContents();
		theUIModelPackage.initializePackageContents();
		theInteractionsPackage.initializePackageContents();
		theWidgetsModelPackage.initializePackageContents();
		thePlateformPackage.initializePackageContents();
		theMappingmodelPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theUipositionningPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(UipositionningPackage.eNS_URI, theUipositionningPackage);
		return theUipositionningPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPositionning() {
		return positionningEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPositionning_Name() {
		return (EReference)positionningEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAbsolute() {
		return absoluteEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getAbsolute_X() {
		return (EAttribute)absoluteEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getAbsolute_Y() {
		return (EAttribute)absoluteEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getAbsolute_Z() {
		return (EAttribute)absoluteEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getAbsolute_Orientation() {
		return (EAttribute)absoluteEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getRelative() {
		return relativeEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getRelative_UiElement() {
		return (EReference)relativeEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getLeftTo() {
		return leftToEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getRightTo() {
		return rightToEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getTopTo() {
		return topToEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getDownTo() {
		return downToEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAttachedTo() {
		return attachedToEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getNestedIn() {
		return nestedInEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getNestedIn_NestedPosition() {
		return (EAttribute)nestedInEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getNestedPositionType() {
		return nestedPositionTypeEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UipositionningFactory getUipositionningFactory() {
		return (UipositionningFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		positionningEClass = createEClass(POSITIONNING);
		createEReference(positionningEClass, POSITIONNING__NAME);

		absoluteEClass = createEClass(ABSOLUTE);
		createEAttribute(absoluteEClass, ABSOLUTE__X);
		createEAttribute(absoluteEClass, ABSOLUTE__Y);
		createEAttribute(absoluteEClass, ABSOLUTE__Z);
		createEAttribute(absoluteEClass, ABSOLUTE__ORIENTATION);

		relativeEClass = createEClass(RELATIVE);
		createEReference(relativeEClass, RELATIVE__UI_ELEMENT);

		leftToEClass = createEClass(LEFT_TO);

		rightToEClass = createEClass(RIGHT_TO);

		topToEClass = createEClass(TOP_TO);

		downToEClass = createEClass(DOWN_TO);

		attachedToEClass = createEClass(ATTACHED_TO);

		nestedInEClass = createEClass(NESTED_IN);
		createEAttribute(nestedInEClass, NESTED_IN__NESTED_POSITION);

		// Create enums
		nestedPositionTypeEEnum = createEEnum(NESTED_POSITION_TYPE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		UIModelPackage theUIModelPackage = (UIModelPackage)EPackage.Registry.INSTANCE.getEPackage(UIModelPackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		absoluteEClass.getESuperTypes().add(this.getPositionning());
		relativeEClass.getESuperTypes().add(this.getPositionning());
		leftToEClass.getESuperTypes().add(this.getRelative());
		rightToEClass.getESuperTypes().add(this.getRelative());
		topToEClass.getESuperTypes().add(this.getRelative());
		downToEClass.getESuperTypes().add(this.getRelative());
		attachedToEClass.getESuperTypes().add(this.getRelative());
		nestedInEClass.getESuperTypes().add(this.getRelative());

		// Initialize classes and features; add operations and parameters
		initEClass(positionningEClass, Positionning.class, "Positionning", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getPositionning_Name(), this.getPositionning(), null, "name", null, 0, 1, Positionning.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(absoluteEClass, Absolute.class, "Absolute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getAbsolute_X(), ecorePackage.getEInt(), "x", "0", 0, 1, Absolute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getAbsolute_Y(), ecorePackage.getEInt(), "y", "0", 0, 1, Absolute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getAbsolute_Z(), ecorePackage.getEInt(), "z", "0", 0, 1, Absolute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getAbsolute_Orientation(), ecorePackage.getEInt(), "orientation", null, 0, 1, Absolute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(relativeEClass, Relative.class, "Relative", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getRelative_UiElement(), theUIModelPackage.getUIElement(), null, "uiElement", null, 0, 1, Relative.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(leftToEClass, LeftTo.class, "LeftTo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(rightToEClass, RightTo.class, "RightTo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(topToEClass, TopTo.class, "TopTo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(downToEClass, DownTo.class, "DownTo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(attachedToEClass, AttachedTo.class, "AttachedTo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(nestedInEClass, NestedIn.class, "NestedIn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getNestedIn_NestedPosition(), this.getNestedPositionType(), "nestedPosition", null, 0, 1, NestedIn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Initialize enums and add enum literals
		initEEnum(nestedPositionTypeEEnum, NestedPositionType.class, "NestedPositionType");
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.CENTER);
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.SOUTH);
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.EAST);
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.WEST);
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.NORTH_EAST);
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.SOUTH_EAST);
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.NORTH_WEST);
		addEEnumLiteral(nestedPositionTypeEEnum, NestedPositionType.SOUTH_WEST);

		// Create resource
		createResource(eNS_URI);
	}

} //UipositionningPackageImpl
